#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include<QWidget>
#include<QGridLayout>
#include"rotors.h"
#include"lightboard.h"
#include"plugboard.h"
#include"header.h"
#include<QLineEdit>
#include<QMainWindow>
#include<QMenu>
#include<QMenuBar>
#include<QAction>
#include<QPushButton>
#include<QKeyEvent>
#include<QMessageBox>
#include<QTime>
#include<QCoreApplication>
#include<string>
using std::string;

class MainWindow : public QMainWindow
{

    Q_OBJECT

public slots :
    void verif_plugs();
    void clean();
    void help();
    void reload();
    void describe();
    void free_and_quit();
    void clicked_on_send();

signals :
    void plugs_ok();
    void free_ok();


private :
    Rotors *zoneRotors;
    LightBoard *zoneLightBoard;
    PlugBoard *zonePlugBoard;
    QLineEdit* log;
    QLineEdit* in;
    QGridLayout *layout_mainWindow;
    QPushButton* valider;
    QPushButton* send;
    Rotor_intern* rotor1;
    Rotor_intern* rotor2;
    Rotor_intern* rotor3;
    Plugboard* plugb;
    Reflecteur* refl;
    int nb_permutations;
    int pos_r1;
    int pos_r2;
    int pos_r3;
    int is_phase2;


public :
    MainWindow();
    int QString_to_int(QString);
    QString int_to_QString(int);
    void keyPressEvent(QKeyEvent *);
    void load_enigma(int);
    void reset_rotor_intern();

};
#endif // MAINWINDOW_H
